﻿using System;

namespace crypter {
    public static class Crypt {

        public static void File(string sourceFileName, string targetFileName, string password) {
            var compareMsg = "Die Datei '" + sourceFileName + "' wurde in die Datei '" + sourceFileName + ".dnpcrypt" + "' verschlüsselt.";

            var cc = new dnpCryptCompress.CryptCompress();
            var msg = cc.FileCrypt(sourceFileName, password);

            if (msg != compareMsg) {
                throw new Exception("msg");
            }

            if (sourceFileName != sourceFileName + ".dnpcrypt") {
                System.IO.File.Move(sourceFileName + ".dnpcrypt", targetFileName);
            }
        }

    }

    public static class DeCrypt {
        
        public static void File(string sourceFileName, string password) {
            var cc = new dnpCryptCompress.CryptCompress();
            var msg = cc.FileDecrypt(sourceFileName, password);
        }
    }
}
